<?php

namespace common\entities\myhtsq;

use common\entities\ContractEntity;
use Yii;

/**
 * This is the model class for table "myscrm_authorization_achievement".
 *
 * @property string $contract_application_id
 * @property string $contract_id
 * @property string $application_id
 * @property string $price
 * @property string $unit
 * @property integer $authorization_type
 * @property integer $authorization_numeric
 * @property string $rent_period
 * @property string $amount
 * @property string $created_by
 * @property string $modified_by
 * @property string $created_on
 * @property string $modified_on
 * @property integer $is_standard
 * @property string $discount_rate
 * @property integer $contract_type
 * @property integer $settlement_type
 * @property string $settlement_scale
 * @property string $origin_settlement_average_amount
 * @property string $origin_sign_average_amount
 * @property string $origin_product_average_amount
 * @property string $adjust_product_average_amount
 * @property string $adjust_sign_average_amount
 * @property string $adjust_settlement_average_amount
 * @property string $product_average_amount
 * @property string $sign_average_amount
 * @property string $settlement_average_amount
 * @property string $discount
 */
class AuthorizationAchievementEntity extends ContractEntity
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'myscrm_authorization_achievement';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['price', 'rent_period', 'amount', 'discount_rate', 'settlement_scale', 'origin_settlement_average_amount', 'origin_sign_average_amount', 'origin_product_average_amount', 'adjust_product_average_amount', 'adjust_sign_average_amount', 'adjust_settlement_average_amount', 'product_average_amount', 'sign_average_amount', 'settlement_average_amount', 'discount','authorization_numeric'], 'number'],
            [['authorization_type', 'is_standard', 'contract_type', 'settlement_type'], 'integer'],
            [['created_on', 'modified_on'], 'safe'],
            [['contract_application_id', 'contract_id', 'application_id', 'created_by', 'modified_by'], 'string', 'max' => 36],
            [['unit'], 'string', 'max' => 30],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'contract_application_id' => '合同产品ID',
            'contract_id' => '合同ID',
            'application_id' => '产品ID',
            'price' => '标准单价',
            'unit' => '单位',
            'authorization_type' => '授权类型 
            0：项目数 
            1：短信数',
            'authorization_numeric' => '授权数',
            'rent_period' => '租用周期（单位：月）',
            'amount' => '标准总额',
            'created_by' => '创建人',
            'modified_by' => '修改人',
            'created_on' => '创建时间',
            'modified_on' => '修改时间',
            'is_standard' => '是否标准产品',
            'discount_rate' => '折扣率',
            'contract_type' => '合同属性，1新增，2增购，3续签',
            'settlement_type' => '结算类型：1.标准结算（默认值）、2.折上折结算、3.特价结算',
            'settlement_scale' => '结算比例',
            'origin_settlement_average_amount' => '原结算分摊金额',
            'origin_sign_average_amount' => '原签约分摊金额',
            'origin_product_average_amount' => '原产品租金分摊金额',
            'adjust_product_average_amount' => '产品租金调整金额',
            'adjust_sign_average_amount' => '签约调整金额',
            'adjust_settlement_average_amount' => '结算调整金额',
            'product_average_amount' => '产品租金分摊金额',
            'sign_average_amount' => '签约分摊金额',
            'settlement_average_amount' => '结算分摊金额',
            'discount' => '折扣',
        ];
    }
}
